﻿
Partial Class Dialogos_frmPopUpBusquedaCentroCosto
    Inherits System.Web.UI.Page
    'Private oDvCentroCosto As DataView
    'Private oDsCentroCosto As New DataSet

    'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '    If Not Page.IsPostBack Then
    '        Response.Cache.SetCacheability(HttpCacheability.NoCache)
    '        Response.Cache.SetExpires(DateTime.Now().Subtract(New TimeSpan(1, 0, 0)))
    '        Response.Cache.SetLastModified(DateTime.Now)
    '        Response.Cache.SetAllowResponseInBrowserHistory(False)
    '        Session.Timeout = 1000
    '        fnRecuperarValoresURL()
    '        fnCargarCentroCosto()
    '    End If
    'End Sub


    'Private Sub fnRecuperarValoresURL()
    '    If Request.QueryString("CentroCosto") Is Nothing Then
    '        Me.txtCentroCosto.Text = String.Empty
    '    Else
    '        Me.txtCentroCosto.Text = Request.QueryString("CentroCosto")
    '    End If

    '    If Request.QueryString("Compania") Is Nothing Then
    '        hidCompania.Value = String.Empty
    '    Else
    '        hidCompania.Value = Request.QueryString("Compania")
    '    End If
    '    If Request.QueryString("Usuario") Is Nothing Then
    '        hidUsuario.Value = String.Empty
    '    Else
    '        hidUsuario.Value = Request.QueryString("Usuario")
    '    End If
    'End Sub
    'Public Function fnCargarDataSet(ByVal psCentroCosto As String, ByVal psDescripcion As String) As DataSet
    '    Dim oDs As New DataSet
    '    Dim sError As String
    '    Dim bOk As Boolean

    '    Dim oNegCentroCosto As New srvNegCentroCosto.srvNegCentroCosto
    '    bOk = oNegCentroCosto.fnListar(3, hidCompania.Value, psCentroCosto, Me.hidUsuario.value, psDescripcion, oDs, sError)
    '    If Not bOk Then
    '        lblMensaje.Text = sError
    '    End If
    '    Return oDs
    'End Function
    'Private Sub fnCargarCentroCosto()
    '    Try
    '        Dim psCentroCosto As String, psDescripcion As String
    '        psCentroCosto = txtCentroCosto.Text.Trim
    '        psDescripcion = txtDescripcion.Text.Trim

    '        oDsCentroCosto = fnCargarDataSet(psCentroCosto, psDescripcion)
    '        If Not oDsCentroCosto Is Nothing Then
    '            oDvCentroCosto = oDsCentroCosto.Tables(0).DefaultView
    '            'Cache("dvw_CentroCosto") = oDvCentroCosto
    '            Session("dvw_CentroCosto") = oDvCentroCosto
    '            grdCentroCosto.CurrentPageIndex = 0
    '            EnlazarDatagrid(grdCentroCosto, oDvCentroCosto)

    '        End If
    '    Catch ex As Exception
    '        lblMensaje.Text = C_MSG_ERROR_INESPERADO
    '        CreateLogFiles()
    '        ErrorLog(Server.MapPath("Logs/ErrorLog"), ex.Message + ex.StackTrace)
    '    End Try
    'End Sub
    'Private Sub btnBuscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbuscar.Click
    '    fnCargarCentroCosto()
    'End Sub


    'Public Function fnCrearCadenaDevolucion(ByVal p1 As String, ByVal p2 As String) As String
    '    Return String.Format("javascript:DevolverValores('{0}','{1}')", p1, p2)
    'End Function

    'Private Sub grdCentroCosto_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles grdcentrocosto.SortCommand
    '    Try
    '        'oDvCentroCosto = Cache("dvw_CentroCosto")
    '        oDvCentroCosto = Session("dvw_CentroCosto")
    '        If ViewState(e.SortExpression) Is Nothing Then
    '            oDvCentroCosto.Sort = New System.Text.StringBuilder().Append(e.SortExpression).Append(" asc").ToString
    '        Else
    '            If ViewState(e.SortExpression).Substring(ViewState(e.SortExpression).Length - 3, 3) = "asc" Then
    '                oDvCentroCosto.Sort = New System.Text.StringBuilder().Append(e.SortExpression).Append(" desc").ToString
    '            Else
    '                oDvCentroCosto.Sort = New System.Text.StringBuilder().Append(e.SortExpression).Append(" asc").ToString
    '            End If
    '        End If
    '        ViewState(e.SortExpression) = oDvCentroCosto.Sort
    '        EnlazarDatagrid(Me.grdCentroCosto, oDvCentroCosto)
    '    Catch ex As Exception
    '        CreateLogFiles()
    '        ErrorLog(Server.MapPath("Logs/ErrorLog"), ex.Message + ex.StackTrace)
    '    End Try
    'End Sub


    'Private Sub grdCentroCosto_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles grdcentrocosto.PageIndexChanged
    '    'oDvCentroCosto = Cache("dvw_CentroCosto")
    '    oDvCentroCosto = Session("dvw_CentroCosto")
    '    Me.grdCentroCosto.CurrentPageIndex = e.NewPageIndex
    '    EnlazarDatagrid(grdCentroCosto, oDvCentroCosto)
    'End Sub
End Class
